<%@ page import="org.jeecgframework.web.service.WxCommonService" %>
<%@ page language="java" contentType="text/html; charset=UTF-8"
         pageEncoding="UTF-8" %>
<%@include file="../../mytags.jsp" %>
<!DOCTYPE html>
<html>
<head>
    <t:base type="jquery"></t:base>
    <script type="text/javascript" src="webpage/com/wx/added_product/procurement/shoppingCar.js"></script>
    <link href="${webRoot}plugin/picker/css/mui.picker.all.css" rel="stylesheet"/>
    <script src="${webRoot}plugin/picker/js/mui.picker.all.js"></script>
    <meta charset="utf-8">
    <meta name="viewport"
          content="width=device-width,initial-scale=1,minimum-scale=1,maximum-scale=1,user-scalable=no"/>
    <title>服务申请</title>
    <style>
        .gdd h3 {
            margin-top: 10px;
        }
    </style>
    <script type="text/javascript" charset="utf-8">
        mui.init();
        $(function () {
            if ($("#detail").val() == 1) {
                $("input").attr("readonly", "readonly");
                $(".verify-code").parent().remove();
                $("#sub").parent().remove();
                $("#createDate").parent().show();
            }
            var picker = null;
            if($("#detail").val() != 1){
                $(".date-drop").click(function () {
                    var o = $(this);
                    if (picker == null) {
                        picker = new mui.DtPicker({
                            "type": "date"
                        })
                    }
                    picker.show(function (e) {
                        o.find("input").val(e.value);
                    })
                })
            }

            $("#sub").click(function () {
                /*马宏刚注释*/
                //serviceSub(formValidName,'cbsGgReconditionController.do?doAdd','<%=WxCommonService.ServiceEnum.GGFX.type%>');
                <%--serviceSub(formValidName,'cbsGgReconditionController.do?doAddNew','<%=WxCommonService.ServiceEnum.GGFX.type%>');--%>
                if (formValidName.check() == false) {
                    $('#formobj').submit();
                } else {
                    var phoneNum = $("#contactsPhone").val();
                    if(phoneNum == ''){
                        return;
                    }
                    mui.confirm("您确认提交订单？",'',['取消','确认'],function(idx){
                        if(idx.index == 1){
                            openMask();
                            $.getJSON("wxMenuController.do?checkVerifyNew",{verifyCode : $("#verifyCode").val(), busType : '<%=StaticValue.RANDOMCODE_SBYJ%>'},function(re){
                                closeMask();
                                if(re.success){
                                    $.post("cbsMerchineMoveController.do?doAddNew", $("#formobj").serialize(), function (data) {
                                        // checkServiceUser(phoneNum,$("#contactsName").val());//建立用户初始化用户
                                        data = $.parseJSON(data);
                                        console.log("data:"+data.obj)
                                        if (data.success) {
                                            mui.openWindow({
                                                createNew: true,
                                                url: "wxMenuController.do?subSuc&param=" + data.obj+"&type="+'<%=WxCommonService.ServiceEnum.SBYJ.type%>'+"&phone="+phoneNum
                                            })
                                        } else {
                                            mui.alert(data.msg,function(){
                                                $(".mui-backdrop").remove();
                                            });
                                        }
                                    });
                                }else{
                                    mui.alert("验证码错误",function(){
                                        $(".mui-backdrop").remove();
                                    });
                                }
                            })
                        }
                    })
                }
            })

        })


    </script>
</head>
<body>

<div class="tel"><a href="tel:400-88-22726"> <img src="${webRoot }images/tel.jpg"></a></div>
<div class="eq1">
    <div class="geren" style="font-weight: bold;margin:10px 0px 10px 15px;">
        <img src="${webRoot }/images/about.jpg">服务订单
    </div>
    <t:formvalid formid="formobj" dialog="false" usePlugin="password" layout="table" action="cbsMerchineMoveController.do?doAddNew"
                 tiptype="popTip" validFormName="formValidName" showAllError="false" callback="subcallback">
        <input type="hidden" name="detail" id="detail" value="${detail}"/>
        <input type="hidden" name="status" value="1"/>
        <input type="hidden" name="id" value="${page.id}"/>
        <div class="mui-card form-card">
            <ul class="mui-table-view">
                <li class="mui-table-view-cell">
                    <span class="fwlx">服务类型</span>
                    <input type="text" class="read" id="serviceType" name="serviceType" value="设备移机" readonly/>
                </li>
                <li class="mui-table-view-cell">
                    <span class="cinema">影院名称<label style="color: red;">*</label></span>
                    <input type="text" name="cinemaName" placeholder="填写影院名称"  value="${cinemaName}" datatype="*2-20" nullmsg="填写影院名称"/>
                </li>
                <li class="mui-table-view-cell">
                    <span class="chain">所属院线</span>
                    <input type="text" name="cinemaChain" placeholder="填写所属院线"  value="${cinemaChain}" datatype="*0-20"/>
                </li>
                <li class="mui-table-view-cell">
                    <span class="point-code">设备序列号<label style="color: red;">*</label></span>
                    <input type="text" name="sn"  value="${sn}" datatype="*"  placeholder="填写设备序列号"/>
                </li>
                <li class="mui-table-view-cell">
                    <span class="point-code">设备台数<label style="color: red;">*</label></span>
                    <input type="text" name="equipmentNum"  value="" datatype="n"  placeholder="填写设备数量(数字)"/>
                </li>
                <li class="mui-table-view-cell" style="padding-bottom:3px !important;">
                    <span class="clock">希望服务时间<label style="color: red;">*</label></span>
                    <label class="date-drop">
                        <input type="text" id="serviceDate" class="dPicker" name="serviceDate"
                               value="<fmt:formatDate value='${serviceDate}' pattern='yyyy-MM-dd'/>" datatype="*1-10" nullmsg="请填写希望服务时间"
                               readonly/><span>&nbsp;&nbsp;&nbsp;&nbsp;</span>
                    </label>
                </li>
            </ul>
        </div>

        <div class="mui-card form-card" style="margin-top: 10px;margin-bottom: 10px;">
            <ul class="mui-table-view">
                <li class="mui-table-view-cell">
                    <span class="contact">联系人姓名<label style="color: red;">*</label></span>
                    <input type="text" name="contactsName" value="${page.realName}" datatype="*2-10" placeholder="填写姓名"/>
                </li>
                <li class="mui-table-view-cell">
                    <span class="m-phone">联系人电话<label style="color: red;">*</label></span>
                    <input type="text" id="contactsPhone" name="contactsPhone" value="${page.mobilePhone}" datatype="cPhone" placeholder="填写手机号"/>
                </li>
                <li class="mui-table-view-cell">
                    <span class="m-phone">联系人邮箱<label style="color: red;">*</label></span>
                    <input type="text" id="contactsEmail" name="contactsEmail" value="${page.email}" datatype="e" nullmsg="请输入邮箱"/>
                </li>
                <li class="mui-table-view-cell">
                    <span class="verify-code">验证码<label style="color: red;">*</label></span>
                    <input type="text" style="width:30%" id="verifyCode" datatype="n" nullmsg="请输入验证码" placeholder="验证码"/>
                        <%--<a href="javascript:sendVerifyCode(<%=StaticValue.SEND_RANDOMCODE_LIVETIME%>)" id="sendBtn" class="a-verify">发送验证码</a>--%>
                    <a href="javascript:sendVerifyCodeNew('wxMenuController.do?sendVerifyCodeNew&serviceType='+$('#serviceType').val(),'<%=StaticValue.SEND_RANDOMCODE_LIVETIME%>','<%=StaticValue.RANDOMCODE_SBYJ%>','contactsPhone')" id="sendBtn" class="a-verify">发送验证码</a>
                </li>
            </ul>
        </div>
    </t:formvalid>
    <div style="width:92%;margin: 0 auto;margin-bottom: 60px;">
        <a class="mui-btn mui-btn-block mui-btn-primary" id="sub">提交订单</a>
    </div>

    <div class="fot" style="position: fixed;bottom: 0px;">
        如需更多服务请拨打服务热线<a href="tel:400-88-22726" style="color:red">400-88-22726</a>咨询
    </div>
</div>
<script type="text/javascript">

</script>
</body>
</html>